import 'package:daoyi_ui_admin_getx/app/routes/app_pages.dart';
import 'package:daoyi_ui_admin_getx/app/widgets/search_bar/search_bar_widget.dart';
import 'package:daoyi_ui_admin_getx/generated/locales.g.dart';
import 'package:flutter/material.dart';

import 'package:get/get.dart';

import 'open_source_controller.dart';
import 'open_source_list_item_data.dart';
import 'open_source_list_item_widget.dart';

class OpenSourceView extends GetView<OpenSourceController> {
  const OpenSourceView({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: SearchBarWidget(
          showLocation: true,
          showMap: true,
          goBackCallback: () {
            Get.back();
          },
          onSearch: () {
            Get.toNamed(Routes.SEARCH_PAGE);
          },
        ),
        centerTitle: true,
        leading: null,
        automaticallyImplyLeading: false,
      ),
      body: SafeArea(
        child: Column(
          children: <Widget>[
            Container(
              height: 40,
              child: Text("filterbar"),
            ),
            Expanded(
              child: ListView(
                children: openSourceListItemData
                    .map(
                      (item) => OpenSourceListItemWidget(item),
                    )
                    .toList(),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
